package springboot.study.project.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName: IndexCountroller
 * @Description: 页面访问控制层
 * @Author: liu-hao
 * @Date: 2021-03-11 22:36
 * @Version: 1.0
 **/
@Controller
public class IndexCountroller {

    @GetMapping("/")
    public String main() {
        return "login";
    }

    @GetMapping("/login")
    public String login() {
        return "login";
    }

    @GetMapping("/main")
    public String main2() {
        return "main";
    }

    @GetMapping("/top")
    public String top() {
        return "top";
    }

    @GetMapping("/left")
    public String left() {
        return "left";
    }

    @GetMapping("/right")
    public String right() {
        return "right";
    }

    @GetMapping("/tab")
    public String tab() {
        return "tab";
    }

    @GetMapping("/index")
    public String index() {
        return "index";
    }

    @GetMapping("/tempRecord")
    public String tempRecord() {
        return "tempRecord";
    }

    @GetMapping("/visitRegister")
    public String visitRegister() {
        return "visitRegister";
    }

    @GetMapping("/pushBulletin")
    public String pushBulletin() {
        return "pushBulletin";
    }

    @GetMapping("/viewBulletin")
    public String viewBulletin(@RequestParam(value = "bulletinId", required = false) String bulletinId, Model model) {
        model.addAttribute("bulletinId", bulletinId);
        return "viewBulletin";
    }

    @GetMapping("/viewBulletinInfo")
    public String viewBulletinInfo() {
        return "viewBulletinInfo";
    }

    @GetMapping("/modifyBulletinInfo")
    public String modifyBulletinInfo(@RequestParam(value = "bulletinId", required = false) String bulletinId, Model model) {
        model.addAttribute("bulletinId", bulletinId);
        return "modifyBulletinInfo";
    }

    @GetMapping("/viewTempRecordInfo")
    public String viewTempRecordInfo() {
        return "viewTempRecordInfo";
    }

    @GetMapping("/viewVisitRecordInfo")
    public String viewVisitRecordInfo() {
        return "viewVisitRecordInfo";
    }

    // 信息管理相关
    @GetMapping("/viewStuInfo")
    public String viewStuInfo() {
        return "viewStuInfo";
    }

    @GetMapping("/addStudent")
    public String addStudent() {
        return "addStudent";
    }

    @GetMapping("/modifyStuInfo")
    public String modifyStuInfo() {
        return "modifyStuInfo";
    }

    @GetMapping("/viewDormitoryInfo")
    public String viewDormitoryInfo() {
        return "viewDormitoryInfo";
    }

    @GetMapping("/addOrModifyDormitory")
    public String addOrModifyDormitory() {
        return "addOrModifyDormitory";
    }

    @GetMapping("/viewDeptInfo")
    public String viewDeptInfo() {
        return "viewDeptInfo";
    }

    @GetMapping("/addOrModifyDept")
    public String addOrModifyDept() {
        return "addOrModifyDept";
    }


    @GetMapping("/viewMajorInfo")
    public String viewMajorInfo() {
        return "viewMajorInfo";
    }

    @GetMapping("/addOrModifyMajor")
    public String addOrModifyMajor() {
        return "addOrModifyMajor";
    }


    @GetMapping("/viewClazzInfo")
    public String viewClazzInfo() {
        return "viewClazzInfo";
    }

    @GetMapping("/addOrModifyClazz")
    public String addOrModifyClazz() {
        return "addOrModifyClazz";
    }

    // 用户相关
    @GetMapping("/viewUserInfo")
    public String viewUserInfo() {
        return "viewUserInfo";
    }

    @GetMapping("/addUser")
    public String addUser() {
        return "addUser";
    }

    @GetMapping("/modifyUserInfo")
    public String modifyUserInfo() {
        return "modifyUserInfo";
    }

    @GetMapping("/viewOwnUser")
    public String viewOwnUser() {
        return "viewOwnUser";
    }


    @GetMapping("/error")
    public String error() {
        return "error";
    }
}
